#include "Process.h"
#include "MemScan.h"
#include "ScanResult.h"

int main(int argc, char *argv[])
{
	//unsigned int aob[] = {0xf0, 0xcf, 0x04, 0xd0, 0x30, 0x57, 0x57};
	//printf("%d\r\n", sizeof(aob) / 4);

//	std::cin.get();

//	return 0;

	Process *p = new Process();

	TRACE("INIT");
	if(!p->OpenProc("Adobe Flash Player 10"))
	{
		MessageBox(0, "Could not open process!", "Error!", MB_OK | MB_ICONERROR);
		return 1000;
	}
	TRACE("PROC OPEN");

	MemScan *scan = new MemScan(p);
	if(scan)
	{
		TRACE("START SCAN");

		scan->Create(C_FLOAT);
	//	scan->Update(C_EQUAL, 4100000);
		scan->Update2(C_BYTES, "0xf00xcf0x040xd0");
		
		//scan->Dump_Scan_Match();

		ScanResult *sr = new ScanResult();

		scan->GetMatches(sr);
		sr->Debug();

		scan->Free();
		TRACE("FREE SCAN");
		delete scan;
		TRACE("END SCAN");


		delete sr;
		TRACE("CLEANUP");
	}
	
	p->CloseProc();
	TRACE("PROCESS CLOSED");
	delete p;
	
	TRACE("COMPLETED PRESS ANY KEY TO EXIT.");
	
	std::cin.get();
}
